<template>
  <div>
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      :router="true" 
      active-text-color="#ffd04b">
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>导航一</span>
        </template>
        <el-menu-item-group>
          <template slot="title">分组一</template>
          <el-menu-item index="/layout/temp">天气工具</el-menu-item>
          <el-menu-item index="/layout/richang">日常工具</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-menu-item index="/layout/test">
        <i class="el-icon-menu"></i>
        <span slot="title">百科工具</span>
      </el-menu-item>
      <el-menu-item index="3" disabled>
        <i class="el-icon-document"></i>
        <span slot="title">导航三</span>
      </el-menu-item>
      <el-menu-item index="4">
        <i class="el-icon-setting"></i>
        <span slot="title">导航四</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: '2209vueMenuCom',

  data() {
    return {
      
    };
  },

  mounted() {
    
  },

  methods: {
      handleOpen(key, keyPath) { //菜单打开
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) { //菜单关闭
        console.log(key, keyPath);
      }
  },
};
</script>